﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;

namespace LiveHub.Share.DataModels;

[Serializable]
public class UserModel
{
    [Column(TypeName = "varchar(50)")] public string UserName { get; init; } = "";

    [Key]
    [Column(TypeName = "varchar(10)")]
    public string UserId { get; init; } = "";

    [Column(TypeName = "varchar(2)")] public string Gender { get; init; } = "";
    [Column(TypeName = "varchar(20)")] public string ClassName { get; init; } = "";
    [Column(TypeName = "varchar(11)")] public string PhoneNum { get; init; } = "";

    [JsonIgnore] public List<GroupModel> Groups { get; set; } = [];
    [JsonIgnore] public List<MessageModel> Messages { get; set; } = [];
}